var ColorLayer = new ol.layer.Tile({
    title: '纯色背景',
    type: 'base',
    visible: true,
    source: new ol.source.XYZ({
        url: ''
    })
});

var WYLLayer = new ol.layer.Tile({
    title: '午夜蓝',
    type: 'base',
    visible: false,
    source: new ol.source.XYZ({
        url: 'http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/{z}/{y}/{x}'
    })
});


var TDTImgLayer = new ol.layer.Group({
    title: '天地图影像',
    type: 'base',
    combine: true,
    visible: false,
    layers: [
        new ol.layer.Tile({
            title: '影像',
            source: new ol.source.XYZ({
                /*url: 'http://webst0{1-4}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'*/
                url: "http://t{0-4}.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}"
            })
        }),
        new ol.layer.Tile({
            title: '影像标注',
            source: new ol.source.XYZ({
                /*url: 'http://webst0{1-4}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}'*/
                url: "http://t{0-4}.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}"
            })
        })
    ]
});

var TDTVecLayer = new ol.layer.Group({
    title: '天地图矢量',
    type: 'base',
    combine: true,
    visible: true,
    layers: [
        new ol.layer.Tile({
            title: '矢量',
            source: new ol.source.XYZ({
                /*url: 'http://webrd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}' */
                url: "http://t{0-4}.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}"
            })
        }),
        new ol.layer.Tile({
            title: '矢量标注',
            source: new ol.source.XYZ({
                url: "http://t{0-4}.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}"
            })
        })
    ]
});

var TDTTopLayer = new ol.layer.Group({
    title: '天地图地形',
    type: 'base',
    combine: true,
    visible: false,
    layers: [
        new ol.layer.Tile({
            source:new ol.source.XYZ({
                title: "天地图地形",
                url:"http://t{0-4}.tianditu.cn/DataServer?T=ter_w&X={x}&Y={y}&L={z}"
            })
        }),
        new ol.layer.Tile({
            source:new ol.source.XYZ({
                title: "天地图文字3",
                url: "http://t{0-4}.tianditu.com/DataServer?T=cta_w&x={x}&y={y}&l={z}"
            })
        })
    ]
});


var GDImgLayer = new ol.layer.Group({
    title: '高德影像',
    type: 'base',
    combine: true,
    visible: false,
    layers: [
        new ol.layer.Tile({
            title: '高德影像2',
            source: new ol.source.XYZ({
                url: 'http://webst0{1-4}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
            })
        }),
        new ol.layer.Tile({
            title: '高德文字',
            source: new ol.source.XYZ({
                url: 'http://webst0{1-4}.is.autonavi.com/appmaptile?style=8&x={x}&y={y}&z={z}'
            })
        }),
    ]
});

var GDVecLayer =new ol.layer.Group({
        title: '高德矢量',
        type: 'base',
        combine: true,
        visible: false,
        layers: [
            new ol.layer.Tile({
                title: '高德矢量2',
                source: new ol.source.XYZ({
                    url: 'http://webrd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
                })
            })
        ]
    });


var BaseLayers=[
    WYLLayer,
    TDTImgLayer,
    TDTVecLayer,
    TDTTopLayer,
    GDImgLayer,
    GDVecLayer

]
